﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Kangaroo.Shell
{
    public partial class PasswordMsgBox : Form
    {
        private readonly string _password;

        public PasswordMsgBox(string psw)
        {
            InitializeComponent();

            _password = psw;
            this.pswErrorLabel.Visible = false;
        }

        private void pswOKButton_Click(object sender, EventArgs e)
        {
            if (this.pswTextBox.Text != _password)
            {
                this.pswTextBox.Focus();
                this.DialogResult = DialogResult.None;
                this.pswErrorLabel.Visible = true;
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
    }
}
